﻿Public Class cCanales
    Private lDrCanla As lbGlobalcom.dsFacturacion.FAC_CANALESRow
    Sub New(ByVal IdCanal As String)
        Try
            Dim daCanal As New lbGlobalcom.dsFacturacionTableAdapters.FAC_CANALESTableAdapter
            Dim dtCanal As lbGlobalcom.dsFacturacion.FAC_CANALESDataTable = daCanal.GetDataByIdCanal(IdCanal)
            If dtCanal.Rows.Count > 0 Then
                lDrCanla = dtCanal.Rows(0)
            Else
                Throw New Exception("Canal no existe, verifique e intente de nuevo")
            End If
        Catch ex As Exception
            cError.SalvaError(ex, "Samuel")
            Throw ex
        End Try


    End Sub

    Public Property IdCanal() As String
        Get
            Return lDrCanla.IDCANAL
        End Get
        Set(ByVal value As String)
            lDrCanla.IDCANAL = value
        End Set
    End Property

    Public Property Descripcion() As String
        Get
            Return lDrCanla.DESCRIPCION
        End Get
        Set(ByVal value As String)
            lDrCanla.DESCRIPCION = value
        End Set
    End Property

    Public Property IdLista() As String
        Get
            Return lDrCanla.IDLISTA
        End Get
        Set(ByVal value As String)
            lDrCanla.IDLISTA = value
        End Set
    End Property

    Protected Overrides Sub Finalize()
        lDrCanla = Nothing
    End Sub
End Class
